package login.dao.impl;

import account.entity.AccountVO;
import generic.dao.impl.GenericDaoImpl;
import login.dao.LoginDao;

import java.util.List;


public class LoginDaoImpl extends GenericDaoImpl<AccountVO,Integer> implements LoginDao {
    @Override
    public AccountVO validateLogin(AccountVO account) {

        Object[] params={account.getLoginAccount(),account.getPassword()};
        List list=this.findObj("from AccountVO a where a.loginAccount=? and a.password=?", params);
        if(list.size() == 0){
            return null;
        }else {
            return (AccountVO) list.get(0);
        }
    }


}
